// components/loading.js
import { config } from '../../config'
import bus from '../../plugins/iny-bus'

Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
		loading: false,
		name: '',
		mask: ''
	},
	created: function(){
    console.log(111111)
		bus.on('loading',(res)=>{
			let style = ''
			if(res.style == undefined || res.style == null){
				style = config().style.loading.default
			}else{
				style = res.style
      }
      let mask = ''
      if(res.mask == undefined || res.mask == null){
				mask = config().style.loading.mask
			}else{
				mask = res.mask
      }

			this.setData({
				loading: res.show,
        name: style,
        mask: mask
			})
		})
	},
	// /**
	//  * 数据监听器 
	//  */
	// observers:{
	// 	"loading,name":function(loading,name){
	// 		this.setData({
	// 			loading: loading,
	// 			name: name
	// 		})
	// 	}
	// },
  /**
   * 组件的方法列表
   */
  methods: {
	}
})
